<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterAddBillRecordBindStartEndTime extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('mybank_bill_record_bind', function (Blueprint $table) {
            $table->unsignedInteger('billStartAt')->default(0)->after('remark')->comment('账单归属开始日期');
            $table->unsignedInteger('billEndAt')->default(0)->after('billStartAt')->comment('账单归属结束日期');

            $table->index('billStartAt', 'idx_billStartAt');
            $table->index('billEndAt', 'idx_billEndAt');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('mybank_bill_record_bind', function (Blueprint $table) {
            $table->dropColumn('billStartAt');
            $table->dropColumn('billEndAt');
        });
    }
}
